#include "Application.h"
#include "MessageProcessor.h"

Application::Application (int screenWidth, int screenHeight)
{
    m_System = 0;
    m_Game = 0;
    m_Renderer = 0;
    m_WindowHandler = 0;

    m_ScreenWidth = screenWidth;
    m_ScreenHeight = screenHeight;
}

Application::~Application()
{
}

void Application::Run ()
{
    m_System = new System (m_ScreenWidth, m_ScreenHeight);
    m_Game = new Game;

    m_Renderer = new Renderer;
    m_Renderer->Init (m_System->GetWindowHandle(), m_ScreenWidth, m_ScreenHeight);

    m_Game->Init();

    LoopsController loopsController;
    loopsController.Run (m_System, m_Game, m_Renderer);

    m_Game->Destroy();

    m_Renderer->Destroy();
    delete m_Renderer;
    delete m_Game;
    delete m_System;
}
/*
System& Application::GetSystem()
{
    return m_System;
}
*/
